/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package es.fpsampayo.fin2006;

import es.fpsampayo.recursos.Conexion;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author fran
 */
public abstract class Padron_Utils {



    public static int getIdPadron(String campo, Object valorcampo){

        int id = 0;
        String sql = "SELECT id FROM bien_inmueble WHERE " + campo + " = \'" + valorcampo + "\';";
        Conexion conexion = new Conexion();
        ResultSet rs = conexion.Select(sql);
        try {
            rs.next();
            id = Integer.parseInt(rs.getObject("id").toString());
        } catch (SQLException ex) {
            Logger.getLogger(Padron_Utils.class.getName()).log(Level.SEVERE, null, ex);
        }
        return id;
    }



}
